package org.huanletao.ssm.controller;

import org.huanletao.ssm.model.RespBean;

/**
 * <p>
 * </p>
 * package: org.huanletao.ssm.controller
 * description:
 * className: BaseController
 * author:  踏雪无痕
 * copyright: Copyright (c) 2022/9/5 15:52
 * since: 1.0.0
 */
public abstract class BaseController {

    /**
     *
     * @param row
     * @return
     */
    public RespBean<Object> toAjax(int row) {
        if (row > 0) {
            return RespBean.ok("操作成功");
        }
        return RespBean.fail("操作失败", "5000");
    }

    /**
     *
     * @param flag
     * @return
     */
    public RespBean<Object> toAjax(Boolean flag) {
        if (flag) {
            return RespBean.ok("操作成功");
        }
        return RespBean.fail("操作失败", "5000");
    }

}
